def copy_yml(model)
  yml = IO.read(File.join(File.dirname(__FILE__), '/test/fixtures/${yml}.yml'))
  new_yml = File.expand_path(File.join(File.dirname(__FILE__), '../../../test/fixtures/${yml}.yml'))
  if File.exists?(new_yml)
      puts '** ${yml}.yml already exists in the /test/fixtures directory.  Feel free to copy the contents of vendor/plugins/account/test/fixtures/${yml}.yml into this file so that you can use the contents in your tests.'
  else
      File.open(new_yml, 'w+') do |file|
          file.print(yml)
      end
  end
end

############################################
# copy yml files
copy_yml('aggregations')
copy_yml('entries')
copy_yml('entries_images')
copy_yml('feeds')
copy_yml('micro_concerts')
copy_yml('micro_conferences')
copy_yml('micro_event_links')
copy_yml('micro_event_people')
copy_yml('micro_events')
copy_yml('services')
copy_yml('tags')
copy_yml('watched_pages')


############################################
# copy over session controller
config = IO.read(File.join(File.dirname(__FILE__), '/app/session_controller.rb'))
config_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../app/controllers/session_controller.rb'))
if !File.exists?(config_file_path)
    File.open(config_file_path, 'w+') do |file|
        file.print(config)
    end
else
    puts '** session_controller.rb already exists in the /app/controllers directory.'
end

############################################
# copy over user controller
config = IO.read(File.join(File.dirname(__FILE__), '/app/users_controller.rb'))
config_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../app/controllers/users_controller.rb'))
if !File.exists?(config_file_path)
    File.open(config_file_path, 'w+') do |file|
        file.print(config)
    end
else
    puts '** users_controller.rb already exists in the /app/controllers directory.'
end

############################################
# copy over user model
config = IO.read(File.join(File.dirname(__FILE__), '/app/user.rb'))
config_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../app/models/user.rb'))
if !File.exists?(config_file_path)
    File.open(config_file_path, 'w+') do |file|
        file.print(config)
    end
else
    puts '** user.rb already exists in the /app/models directory.'
end

############################################
# copy over user_observer model
config = IO.read(File.join(File.dirname(__FILE__), '/app/user_observer.rb'))
config_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../app/models/user_observer.rb'))
if !File.exists?(config_file_path)
    File.open(config_file_path, 'w+') do |file|
        file.print(config)
    end
else
    puts '** user_observer.rb already exists in the /app/models directory.'
end

############################################
# copy over user_observer model
config = IO.read(File.join(File.dirname(__FILE__), '/app/user_notifier.rb'))
config_file_path = File.expand_path(File.join(File.dirname(__FILE__), '../../../app/models/user_notifier.rb'))
if !File.exists?(config_file_path)
    File.open(config_file_path, 'w+') do |file|
        file.print(config)
    end
else
    puts '** user_notifier.rb already exists in the /app/models directory.'
end


# output readme
puts '*******************************************************'
puts IO.read(File.join(File.dirname(__FILE__), 'README'))